package org.aceor.mddal.config.datasource;

import com.google.common.base.Objects;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;

/**
 * Created by lxue on 16/3/27.
 */
@XStreamAlias("atom")
public class Atom {
    @XStreamAsAttribute
    private String id;

    private String url;

    private String username;

    private String password;

    private String driverClassName;

    private int initialSize;

    private int maxActive;
    private int maxWait;
    private int maxIdle;
    private int minIdle;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getDriverClassName() {
        return driverClassName;
    }

    public void setDriverClassName(String driverClassName) {
        this.driverClassName = driverClassName;
    }

    public int getInitialSize() {
        return initialSize;
    }

    public void setInitialSize(int initialSize) {
        this.initialSize = initialSize;
    }

    public int getMaxActive() {
        return maxActive;
    }

    public void setMaxActive(int maxActive) {
        this.maxActive = maxActive;
    }

    public int getMaxWait() {
        return maxWait;
    }

    public void setMaxWait(int maxWait) {
        this.maxWait = maxWait;
    }

    public int getMaxIdle() {
        return maxIdle;
    }

    public void setMaxIdle(int maxIdle) {
        this.maxIdle = maxIdle;
    }

    public int getMinIdle() {
        return minIdle;
    }

    public void setMinIdle(int minIdle) {
        this.minIdle = minIdle;
    }

    @Override
    public String toString() {
        return Objects.toStringHelper(this)
                .add("id",this.getId())
                .add("driverClassName",this.getDriverClassName())
                .add("url",this.getUrl())
                .add("username",this.getUsername())
                .add("password",this.getPassword())
                .add("initialSize",this.getInitialSize())
                .add("maxActive",this.getMaxActive())
                .add("maxIdle",this.getMaxIdle())
                .add("minIdle",this.getMinIdle())
                .add("maxWait",this.getMaxWait())
                .toString();
    }
}
